package com.openharmony.filepicker.config;

import com.openharmony.filepicker.ResourceTable;
import com.openharmony.filepicker.adapter.FileListAdapter;
import com.openharmony.filepicker.bean.FileBean;
import ohos.agp.components.Component;

/**
 * @author rosu
 * @date 2018/11/30
 * 提供条目点击监听器的默认实现
 */
public class FileItemOnClickListenerImpl implements FileItemOnClickListener {

    /**
     * 条目被点击默认实现
     */
    @Override
    public void onItemClick(FileListAdapter itemAdapter, Component itemView, int position) {

    }

    /**
     * 条目子控件被点击默认实现
     */
    @Override
    public void onItemChildClick(FileListAdapter itemAdapter, Component itemView, int position) {

    }

    /**
     * 条目被长按默认实现
     */
    @Override
    public void onItemLongClick(FileListAdapter itemAdapter, Component itemView, int position) {
        if (itemView.getId() != ResourceTable.Id_item_list_file_picker) {
            return;
        }
        FileBean item = itemAdapter.getItem(position);
        if (item == null) {
            return;
        }
        //TODO 实现长按功能
    }
}
